package cn.akwangl.design.pattern.behavioral.observerpattern.v1;

/**
 * 观察者模式#demo
 *
 * @author youyongkun
 * @date 2021/12/6 15:27
 */
public class ObserverPatternTest {

    public static void main(String[] args) {
        Subject subject = new ConcreteSubject();

        ConcreteObserver concreteObserver1 = new ConcreteObserver();
        ConcreteObserver concreteObserver2 = new ConcreteObserver();
        subject.add(concreteObserver1);
        subject.add(concreteObserver2);

        subject.notifyObserver();
    }
}
